xen: Fix my changes to I/O-region-finding routine.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 3 Jul 2007 12:44:04 +0000 (13:44 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 3 Jul 2007 12:44:04 +0000 (13:44 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/mm.c

index b2f6a99624004ad1922ddd8408b10e16c731eae7..c627af93bcc78e46f133c830882196217e81a4c6 100644 (file)
@@ -211,13 +211,12 @@ void __init arch_init_memory(void)
         share_xen_page_with_guest(mfn_to_page(i), dom_io, XENSHARE_writable);
  
     /* Any areas not specified as RAM by the e820 map are considered I/O. */
-    pfn = i = 0;
-    while ( pfn < max_page )
+    for ( i = 0, pfn = 0; pfn < max_page; i++ )
     {
         while ( (i < e820.nr_map) && (e820.map[i].type != E820_RAM) )
             i++;
 
-        if ( i == e820.nr_map )
+        if ( i >= e820.nr_map )
         {
             /* No more RAM regions: mark as I/O right to end of memory map. */
             rstart_pfn = rend_pfn = max_page;